<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height">
    <title>首页</title>
    <style>
        ::-webkit-scrollbar {
            display: none;
        }

        html,
        body {
            overflow: hidden;
            height: 100%;
            margin: 0;
        }

        #goManagerWrap {
            text-align: center;
        }

        #goManagerLink {
            text-decoration: none;
        }
    </style>
</head>

<body>
<div id="total-chart"></div>
<div id="goManagerWrap"><a id="goManagerLink" href="/thesis">前往管理</a></div>
<script>/*Fixing iframe window.innerHeight 0 issue in Safari*/
    document.body.clientHeight;
</script>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g2-3.4.1/dist/g2.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.10.1/dist/data-set.min.js"></script>
<script>
    let data = JSON.parse(`${data}`);
    let chart = new G2.Chart({
        container: 'total-chart',
        forceFit: true,
        height: window.innerHeight * 0.8
    });
    chart.source(data, {
        percent: {
            formatter: function formatter(val) {
                val = val * 100 + '%';
                return val;
            }
        }
    });
    chart.coord('theta', {
        radius: 0.5
    });
    chart.tooltip({
        showTitle: true,
        title: ' ',
        itemTpl: '<li><span style="background-color:{color};" class="g2-tooltip-marker"></span>{name}: {value}</li>'
    });
    chart.intervalStack().position('percent').color('item').label('percent', {
        formatter: function formatter(val, item) {
            return item.point.item + ': ' + val;
        }
    }).tooltip('item*percent', function (item, percent) {
        // percent = percent * 100 + '%';
        return {
            name: item,
            value: "约 " + percent * 100 + " %"
        };
    }).style({
        lineWidth: 1,
        stroke: '#fff'
    });

    chart.render();
</script>
</body>

</html>